import java.util.StringTokenizer;


class P10994_39643 {

//	static HashMap<Integer, Long> map = new HashMap<Integer, Long>();
	
	public static void main(String[] args) {
		while (true) {
			StringTokenizer st = new StringTokenizer(readLn());
			
			int p = Integer.parseInt(st.nextToken());
			int q = Integer.parseInt(st.nextToken());
			
			if (p < 0 && q < 0) break;
			
			if (p == 0)
				System.out.println(calc(q));
			else System.out.println((long)((long)calc(q) - (long)calc(p - 1)));
		}
	}
					//   0, 1, 2, 3,  4,  5,  6,  7,  8, 9
	static long[] sums = {0, 1, 3, 6, 10, 15, 21, 28, 36, 45};
	
	private static long calc(long a) {
		long p0  = 	sums[(int)(a % 10)];
		long p1  = ((45) * (a / 10)) + 			sums[(int)((a/10) % 10)];
		long p2  = ((45) * (a / 100)) + 		sums[(int)((a/100) % 10)];
		long p3  = ((45) * (a / 1000)) + 		sums[(int)((a/1000) % 10)];
		long p4  = ((45) * (a / 10000)) + 		sums[(int)((a/10000) % 10)];
		long p5  = ((45) * (a / 100000)) + 		sums[(int)((a/100000) % 10)];
		long p6  = ((45) * (a / 1000000)) + 	sums[(int)((a/1000000) % 10)];
		long p7  = ((45) * (a / 10000000)) + 	sums[(int)((a/10000000) % 10)];
		long p8  = ((45) * (a / 100000000)) + 	sums[(int)((a/100000000) % 10)];
		long p9  = ((45) * (a / 1000000000)) + 	sums[(int)((a/1000000000) % 10)];
		long p10 = ((45) * (a / 10000000000L))+ sums[(int)((a/10000000000L) % 10)];
		return p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 ;
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
	
}
